﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Ex_Spouse : RelationBase
    {
        private static Ex_Spouse _singleton = new Ex_Spouse();
        public static Ex_Spouse Instance
        {
            get { return _singleton; }
        }

        private Ex_Spouse() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's Ex_Spouse IFF DEFINED (by change of spouse)
            return a.KnownRelation(Ex_Spouse.Instance, b);
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Spouse.Instance });
        }
    }
}
